<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>strings</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_2087">&nbsp;</a>NAME</h4><blockquote>
strings - find printable strings in files
</blockquote><h4><a name = "tag_001_014_2088">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

strings <b>[</b>-a<b>][</b>-t <i>format</i><b>][</b>-n <i>number</i><b>][</b><i>file</i>...<b>]</b>

strings <b>[</b>-<b>][</b>-t <i>format</i><b>][</b>-<i>number</i><b>][</b><i>file</i>...<b>]</b>
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_2089">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>strings</i>
utility looks for printable strings in regular files and
writes those strings to standard output.
A printable string is any sequence
of four (by default) or more
printable characters terminated by a
newline
or NUL character.
Additional implementation-dependent strings may be written.
(See
<i><a href="localedef.html">localedef</a></i>.)
</blockquote><h4><a name = "tag_001_014_2090">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>strings</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> 
except that the obsolescent version uses "-"
in a non-standard way and allows a multi-digit option,
<b>-</b><i>number</i>.
<p>
The following options are supported:
<dl compact>

<dt><b>-a</b>
<dd>
<dt><b>-</b><dd>Scan files in their entirety.
If
<b>-a</b>
is not specified, it is
implementation-dependent
what portion of each file is
scanned for strings.

<dt><b>-n&nbsp;</b><i>number</i>
<dd>
<dt><i>-number</i><dd>
Specify the minimum string length, where the
<i>number</i>
argument is a positive decimal integer.
The default is 4.

<dt><b>-t&nbsp;</b><i>format</i>
<dd>
Write each string preceded by its byte offset
from the start of the file.
The format is dependent on the single
character used as the
<i>format</i>
option-argument:
<dl compact>

<dt><b>d</b><dd>The offset will be written in decimal.

<dt><b>o</b><dd>The offset will be written in octal.

<dt><b>x</b><dd>The offset will be written in hexadecimal.

</dl>
<p>
</dl>
</blockquote><h4><a name = "tag_001_014_2091">&nbsp;</a>OPERANDS</h4><blockquote>
The following operand is supported:
<dl compact>

<dt><i>file</i><dd>A pathname of a regular file to be used as input.
If no
<i>file</i>
operand is specified, the
<i>strings</i>
utility will read from the standard input.

</dl>
</blockquote><h4><a name = "tag_001_014_2092">&nbsp;</a>STDIN</h4><blockquote>
See the INPUT FILES section.
</blockquote><h4><a name = "tag_001_014_2093">&nbsp;</a>INPUT FILES</h4><blockquote>
The input files named by the utility arguments or the
standard input must be regular files of any format.
</blockquote><h4><a name = "tag_001_014_2094">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>strings</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.

<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments and input files)
and to identify printable strings.

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_2095">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_2096">&nbsp;</a>STDOUT</h4><blockquote>
Strings found are written to the standard output, one per line.
<p>
When the
<b>-t</b>
option is not specified, the format of the output is:
<p><code>
<tt>"%s"</tt>, &lt;<i>string</i>&gt;
</code>
<p>
With the
<b>-t&nbsp;o</b>
option, the format of the output is:
<p><code>
<tt>"%o %s"</tt>, &lt;<i>byte offset</i>&gt;,
&lt;<i>string</i>&gt;
</code>
<p>
With the
<b>-t&nbsp;x</b>
option, the format of the output is:
<p><code>
<tt>"%x %s"</tt>, &lt;<i>byte offset</i>&gt;,
&lt;<i>string</i>&gt;
</code>
<p>
With the
<b>-t&nbsp;d</b>
option, the format of the output is:
<p><code>
<tt>"%d %s"</tt>, &lt;<i>byte offset</i>&gt;,
&lt;<i>string</i>&gt;
</code>
</blockquote><h4><a name = "tag_001_014_2097">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_2098">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2099">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2100">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>Successful completion.

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_2101">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_2102">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
By default the data area (as opposed to the text, &quot;bss&quot;
or header areas) of a binary executable file is scanned.
Implementations will document which areas are scanned.
<p>
Some historical implementations do not require NUL or
newline character
terminators for strings to permit those languages that
do not use NUL as a string terminator to have their
strings written.
</blockquote><h4><a name = "tag_001_014_2103">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2104">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2105">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="nm.html">nm</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
